import apibase from "@/api/apiBase";
import axios from "axios";
import { listInterface, detailInterface, addInterface, editInterface, delInterface } from "./menu.interface";
//菜单
export const $menuList = (params: listInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/menu/list',
    data: params,
    instance,
  });
}

// 菜单详情
export const $menuDetail = (params: detailInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/menu/detail',
    data: params,
    instance,
  });
}

// 菜单添加
export const $menuAdd = (params: addInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/menu/add',
    data: params,
    instance,
  });
}

// 菜单编辑
export const $menuEdit = (params: editInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/menu/edit',
    data: params,
    instance,
  });
}

// 菜单删除
export const $menuDelete = (params: delInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/menu/del',
    data: params,
    instance,
  });
}